#ifndef MUDNMUCKACTOR
#define MUDNMUCKACTOR

#include <queue>
#include "room.h"
#include "cell.h"


/**
*    The Actor class is a class meant as a common point for Player and AiPlayer to derive from
*    It implements the functions common to both.
*/

class Actor : public GameObject{

     protected:
          std::string Name;
          Cell* CurrentCell, NextCell;
          std::queue<Cell*> MoveQ;
          //std::map<int,item*> Inventory;
          bool canmove,inCombat;
          int HP;
          GameObject* Target;

     public:
		 Actor(){};
          ///Sets the name
          inline void setName(std::string newname){Name = newname;}

          ///Gets the name
          inline std::string getName(){return(Name);} 

          ///Say a message in general chat for the room.
          //void Say(std::string msg){CurrentRoom->AddChat(msg);}

          ///Gets the current cell we are on.
          inline Cell* getCell(){return CurrentCell;}

          ///Stop moving          
		  void StopMovement(){while(!MoveQ.empty()){MoveQ.pop();}}

          ///Handles actual movement
          void Move(Cell* toCell)
          {
               if(toCell->isAdj(CurrentCell) && !toCell->isSolid())
               {
                    NextCell = *toCell;
               }else{
                    StopMovement();
               }
          }
          
          ///Process Movements that are in the MoveQ
          void ProcessMovement()
          {
               if(!MoveQ.empty())
               {
                    Move(MoveQ.front());
                    MoveQ.pop();
               }

          }

          ///Handle our Tick event
          void ProcessTick()
          {
               ProcessMovement();
          }

};
#endif